/**
 * Created by user on 2018/5/21.
 */
import React, { Component } from 'react'
import { connect } from 'react-redux'
import MaterialSwiperItem from './materialSwiperItem'

class MaterialSwiper extends Component {
  renderItem() {
    const { images, index } = this.props
    const list = []
    images.map((item, index) => {
      list.push(
        <MaterialSwiperItem item={item} key={index} index={index}/>
      )
    })
    return list
  }
  render() {
    return (
      <div className="live_swiper">
        { this.renderItem() }
      </div>
    )
  }
}

const mapStateToProps = (state) => {
  return state.MaterialState
}

export default connect(mapStateToProps)(MaterialSwiper)
